<script lang="ts" setup>
  import { usePaginationTable } from '@/hooks/arco/usePaginationTable';
  import { queryDeviceList } from '@/api/device-management/device';

  const columns = [
    {
      title: '设备ID',
      dataIndex: 'productId',
    },
    {
      title: '设备名称',
      dataIndex: 'productName',
    },
    {
      title: '设备状态',
      dataIndex: 'productStatusLabel',
    },
    {
      title: '设备类型',
      dataIndex: 'productTypeLabel',
    },
    {
      title: '设备型号',
      dataIndex: 'productModel',
    },
    {
      title: '设备编号',
      dataIndex: 'productSn',
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
    },
    {
      title: '操作',
      align: 'center' as const,
      dataIndex: 'action',
      slotName: 'action',
    },
  ];

  const pgTable = usePaginationTable({
    getQueryParams() {
      // 可以添加附加参数查询，如表单查询
      return {};
    },
    apiFun: queryDeviceList,
    columns,
  });
</script>

<template>
  <div>
    <a-table v-bind="pgTable.bindProps" />
  </div>
</template>

<style></style>
